package testit;

import banking.BankImpl;
import interfaces.*;

import money.Money;



public class Mehrtest {
	//BankImpl blubb = new BankImpl("haha");
	public static BankRegistry reg = new BankRegistry();

	public static void main(String[] args) throws Exception {
		
		
		Money money = new Money(80);
		//BankImpl blubb = new BankImpl("haha");
		//reg.newBank("bla");
		reg.newBank("Volksbank");
		reg.newBank("Sparkasse");
		
		
		BankImpl Sparkasse = BankRegistry.loockup("Sparkasse");
		BankImpl Volksbank = BankRegistry.loockup("Volksbank");
		/*
		Volksbank.newDepositAccount(1002, "andy", 1, "de", "de");
		Sparkasse.newGiroAccount(1001, "test1", 1, "de", "de");
		Volksbank.newGiroAccount(1001, "test2", 1, "de", "de");
		Volksbank.removeMoney(money, "test1", 1002);
		Sparkasse.removeMoney(money, "test1", 1001);
		reg.newBank("DiBa");
		BankImpl DiBa = BankRegistry.loockup("DiBa");
		Sparkasse.addMoney(money, "tes2", 1001);
		DiBa.newDepositAccount(1001, "andy", 1, "de", "de");
		DiBa.addMoney(money, "test1", 1001);
		Volksbank.removeMoney(money, "test2", 1002);
		Volksbank.removeMoney(money, "test1", 1001);
		DiBa.addMoney(money, "test1", 1001);
		DiBa.addMoney(money, "test5", 1001);
		DiBa.addMoney(money, "test6", 1001);
		DiBa.addMoney(money, "test2", 1001);
		DiBa.addMoney(money, "test3", 1001);
		DiBa.accountStatement(1001);
		*/
		/*
		System.out.println(Volksbank.showAccountValue(1002));
		System.out.println(Volksbank.showAccountValue(1001));
		System.out.println(Sparkasse.showAccountValue(1001));
		System.out.println(DiBa.showAccountValue(1001));
		
		/*
		Sparkasse.newGiroAccount(1001, "andy", 1, "de", "de");
		Sparkasse.newGiroAccount(1002, "bla1", 1, "de", "de");
		Sparkasse.addMoney(money, "test1", 1001);
		Sparkasse.removeMoney(money, "test", 1001);
		System.out.println(Sparkasse.showAccountValue(1001));
		Volksbank.newDepositAccount(1001, "giro", 1, "de", "de");
		System.out.println(Volksbank.showAccountValue(1001));
		*/
		
		//###### B2B
		/*
		 * Sparkasse überweist 1000 auf das Konto von der Volksbank
		 * beide Konto nummer haben den betrag 1001
		 */
		/*
		Volksbank.newGiroAccount(1001, "test1", 1, "de", "de");
		Sparkasse.newDepositAccount(1001, "andy", 1, "de", "de");
		Sparkasse.transferB2B(1001, 1001, "Volksbank", money, "test1");
		
		System.out.println(Volksbank.showAccountValue(1001));
		System.out.println(Sparkasse.showAccountValue(1001));
		*/
		
		//DebugHandler handler = new DebugHandler(BankRegistry.bankMap.get("haha"));
		/*
		UserInterface l = (UserInterface) Proxy.newProxyInstance(
				UserInterface.class.getClassLoader(),
	            new Class[] { UserInterface.class },
	            handler);
		*/

		//Clockwork clock = Clockwork.getInstance();
		//clock.startTiming();
		/*
		money.setValue(50);
		l.newDepositAccount(1001, "andy", 1, "de", "de");
		l.removeMoney(money, "test1", 1001);
		l.removeMoney(money, "andy", 1001);

		
		System.out.println(l.showAccountValue(1001));
		*/
		
		
		//########## MIME Type testing
		
		Sparkasse.newDepositAccount(1001, "andy", 1, "de", "de");
		Sparkasse.addMoney(money, "test1", 1001);
		Sparkasse.addMoney(money, "test2", 1001);
		Sparkasse.addMoney(money, "test3", 1001);
		Sparkasse.removeMoney(money, "test4", 1001);
		Sparkasse.accountStatement(1001, "text/html");
		
	}

}
